home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Softdisk Supreme
/
Softdisk Supreme.iso
/
pc
/
DSK Files
/
0-49
/
SD018b.dsk
/
DRILL.REVIEW.bas
< prev
next >
Wrap
BASIC Source File
|
2003-06-12
|
7KB
|
232 lines
1 REM ADDITION DRILL AND PRACTICE
2 REM COPYRIGHT (C) 1982 - JOHN BEIDLER
3 REM MAY BE DUPLICATED FOR
4 REM EDUCATIONAL PURPOSES BUT
5 REM NOT FOR RESALE
10 DIM A(10),P(10,10)
11 D$ = "<CTRL-D>"
15 GOSUB 4000: REM MARQUE
30 GOSUB 2000: REM MAIN PROCEDURE
99 END
300 REM FILE THE PROBLEM
305 X5 = X5 +1
330 FOR I5 = 0 TO N0 -1
335 FOR J5 = 0 TO S0 -1
340 INPUT P(I5,J5)
350 NEXT J5: NEXT I5
355 INPUT Z$
399 RETURN
400 REM CARRY ERROR
410 IF I4 = I THEN R8 = R8 +1
412 IF I4 < >I THEN R8 = 0:I4 = I
420 VTAB 12 -N0 -2 -R8: HTAB 20 +S0 -2 *I
430 INVERSE : PRINT A9;: NORMAL
499 RETURN
500 REM ANSWER ERROR
510 IF I4 = I THEN R8 = R8 +1
512 IF I4 < >I THEN R8 = 0:I4 = I
520 VTAB 12 +N0 +2 +R8: HTAB 20 +S0 -2 *I
530 INVERSE : PRINT A9;: NORMAL
599 RETURN
600 REM ERROR HANDLER
601 I4 = -1:R$ = " ":R8 = 0
602 VTAB 1: HTAB 1
604 ONERR GOTO 700
605 INPUT Q$
610 IF (Q$ = "N") OR (Q$ = "S") THEN RETURN
615 INPUT I: INPUT A9
616 IF Q$ < >R$ THEN I4 = -1:R8 = 0
620 IF Q$ = "A" THEN GOSUB 500
630 IF Q$ = "C" THEN GOSUB 400
631 R$ = Q$
640 VTAB 1: HTAB 1
680 INPUT Z$
690 GOTO 605
699 RETURN
700 REM END OF PROCESS
705 PRINT : VTAB 23: PRINT "ANY KEY TO CONTINUE"
710 GOSUB 3900
720 PRINT D$;"CLOSE ";N$
730 HOME : VTAB 10: PRINT "SHOULD THIS STUDENT'S FILE BE REMOVED?"
745 PRINT "(Y/N)? ";: GET A$: PRINT A$
750 IF A$ = "Y" THEN 770
755 IF A$ < >"N" THEN 730
760 GOTO 798
770 PRINT D$;"DELETE ";N$
780 PRINT D$;"DELETE ";N$;".FINAL"
798 GOTO 2040
799 END
800 REM SET UP A PROBLEM
801 HOME : VTAB 2: HTAB 1: PRINT "PROBLEM NO. ";P;" OF ";M9;: HTAB 28
802 IF Q$ = "N" THEN PRINT "ADDITION"
803 IF Q$ = "S" THEN PRINT "SUBTRACTION"
804 VTAB 3: PRINT "DRILL RESULTS FOR ";N$;: VTAB 1: HTAB 1
805 P(N0,0) = 0
810 GOSUB 300
820 FOR I = 0 TO S0 -1:A(I) = 0
830 FOR J = 0 TO N0:A(I) = A(I) +P(J,I): NEXT J
840 Q = INT(A(I)/10)
845 A(I) = A(I) -10 *Q
850 P(N0,I +1) = Q
860 NEXT I
870 A(S0) = Q
900 REM DISPLAY
905 FOR I = 0 TO N0
906 VTAB 12 +N0 -1 -2 *I
907 IF (I = N0) AND (Q$ = "S") THEN 929
910 FOR J = 0 TO S0 -1
912 HTAB 20 +S0 -2 *J
915 PRINT P(I,J);
920 NEXT J
921 IF I = N0 THEN 929
922 FOR J = S0 -1 TO 0 STEP -1: HTAB 20 +S0 -2 *J
924 IF P(I,J) < >0 THEN 929
925 PRINT " ";: NEXT J
929 NEXT I
930 VTAB 12 +N0: HTAB 20 -S0 -1
935 FOR J = 0 TO S0: PRINT "--";: NEXT J
939 IF Q$ = "S" THEN 945
940 VTAB 12 -N0: HTAB 20 -S0 -1
942 FOR J = 0 TO S0: PRINT "--";: NEXT J
944 VTAB 12 -N0 -1: HTAB 20 -S0 -7: PRINT "CARRY"
945 VTAB 12 +N0 +1: HTAB 20 -S0 -7: PRINT "ANSWER";
950 FOR I = S0 TO 0 STEP -1
951 IF (Q$ = "S") AND (I = S0) THEN 965
955 HTAB 20 +S0 -2 *I
960 PRINT A(I);
965 NEXT I
970 VTAB 12 +N0 -1: HTAB 20 -S0 -1
971 IF Q$ = "S" THEN PRINT "-"
972 IF Q$ = "N" THEN PRINT "+"
999 RETURN
1000 REM DRILL AND PRACTICE
1015 X3 = FRE(0): REM HOUSE CLEANING
1018 INPUT Q$: INPUT P
1020 GOSUB 800: REM GET A PROBLEM
1030 GOSUB 600: REM GO THROUGH A PROBLEM
1050 PRINT : VTAB 23: PRINT "ANY KEY TO CONTINUE"
1060 GOSUB 3900
1070 INPUT P
1075 X3 = FRE(0): REM HOUSE CLEANING
1080 GOTO 1020
1099 RETURN
1100 REM OPEN/APPEND PROCEDURE
1105 PRINT
1110 PRINT D$;"OPEN ";N$
1120 PRINT D$;"READ ";N$
1129 RETURN
1150 REM CLOSE FILE PROCEDURE
1151 PRINT
1155 PRINT D$;"CLOSE ";N$
1159 RETURN
1200 REM PAUSE PROCEDURE
1210 FOR Z7 = 0 TO 1500: NEXT Z7
1219 RETURN
2000 REM MAIN PROCEDURE
2010 GOSUB 2800: REM GET STUDENT NAME AND SET UP DATA FILE
2020 GOSUB 1000: REM DRILL PROCEDURE
2040 PRINT : PRINT : PRINT "DO YOU WISH TO REVIEW ANOTHER STUDENT?"
2045 PRINT "(Y/N)? ";: GET A$: PRINT A$: VTAB 12
2050 IF A$ = "Y" THEN 2000
2055 IF A$ < >"N" THEN 2040
2080 GOSUB 4000
2099 PRINT D$;"RUN START.DRILLS"
2800 : REM STUDENT SET UP
2805 HOME : PRINT D$;"CATALOG"
2806 PRINT
2810 PRINT "ENTER ";: INVERSE : PRINT "FILE NAME";: NORMAL : PRINT " THEN PRESS 'RETURN'"
2815 INPUT N$
2816 IF LEN(N$) = 0 THEN RETURN
2818 GOSUB 3000
2820 PRINT D$;"OPEN ";N$
2822 PRINT D$;"READ ";N$
2823 INPUT A$
2824 INPUT M9: INPUT N0: INPUT S0
2830 GOSUB 3020
2899 RETURN
3000 REM STUDENT WRAPUP
3010 HOME : VTAB 3: PRINT "DRILL RESULTS FOR ";N$: PRINT : PRINT
3011 PRINT D$;"OPEN ";N$;".FINAL"
3012 PRINT D$;"READ ";N$;".FINAL"
3014 INPUT A$,M9
3016 INPUT X5: FOR K2 = 0 TO 3: INPUT E(K2): NEXT K2
3019 PRINT D$;"CLOSE ";N$;".FINAL": RETURN
3020 PRINT M9 -X5;" PROBLEMS CORRECT OUT OF ";M9: PRINT
3030 PRINT "THAT'S "; INT(100 *(M9 -X5)/M9);"%": PRINT
3040 PRINT : PRINT : PRINT
3050 PRINT "ERRORS FIRST RETRY ": PRINT
3060 PRINT "ANSWER";: HTAB 13: PRINT E(1);: HTAB 23: PRINT E(3): PRINT
3070 PRINT "CARRY ";: HTAB 13: PRINT E(0);: HTAB 23: PRINT E(2): PRINT
3080 GOSUB 1200: PRINT : PRINT
3090 PRINT "ANY KEY TO CONTINUE"
3091 GOSUB 3900
3099 RETURN
3900 REM KEYBOARD PEEKER
3910 POKE 49168,0
3920 X8 = PEEK(49152)
3925 IF X8 <128 THEN 3920
3930 X8 = X8 -128:C$ = CHR$(X8)
3998 POKE 49168,0
3999 RETURN
4000 REM MARQUE
4001 HOME
4010 VTAB 2:A$ = "ARITHMETIC DRILL AND PRACTICE": GOSUB 4100
4015 VTAB 3: INVERSE :A$ = "TEACHER REVIEW": GOSUB 4100
4016 NORMAL
4020 VTAB 5:A$ = "COPYRIGHT (C) 1982 - J. BEIDLER": GOSUB 4100
4025 VTAB 7:A$ = "ALL RIGHTS RESERVED": GOSUB 4100
4029 GOSUB 1200
4090 GOSUB 1200: GOSUB 1200: GOSUB 1200
4099 RETURN
4100 REM CENTER ON GIVEN LINE
4110 X3 = LEN(A$)
4120 HTAB 20 -(X3/2)
4130 PRINT A$
4199 RETURN
7800 REM TEACHER SET UP
7809 VTAB 8
7810 PRINT "NUMBER OF DIGITS PER NUMBER (1-8)? ";
7811 GET A$: PRINT A$: IF (A$ <"1") OR (A$ >"8") THEN 7810
7812 S0 = ASC(A$) - ASC("0")
7814 PRINT
7815 PRINT "NUMBER OF NUMBERS TO BE ADDED (2-5) ?";
7818 GET A$: PRINT A$: IF (A$ <"2") OR (A$ >"5") GOTO 7815
7820 N0 = ASC(A$) - ASC("0")
7821 PRINT
7822 PRINT "NUMBER OF RETRIES PER DIGIT (0-9)? ";
7823 GET A$: PRINT A$: IF (A$ <"0") OR (A$ >"9") GOTO 7823
7824 R9 = ASC(A$) - ASC("0")
7825 PRINT
7826 INPUT "PROBLEMS PER DRILL (THEN 'RETURN')? ";M9
7829 PRINT
7830 PRINT "REQUIRE CARRY ENTRIES (Y/N)? ";
7832 GET C$: PRINT C$;
7834 IF (C$ < >"Y") AND (C$ < >"N") THEN HTAB 1: GOTO 7830
7840 PRINT : PRINT
7865 INVERSE : PRINT "INFORMATION CORRECT (Y/N)?";: NORMAL
7868 GET A$: PRINT A$;
7875 IF A$ = "Y" THEN PRINT : RETURN
7878 IF A$ < >"N" THEN HTAB 1: GOTO 7865
7880 HOME : GOSUB 7900: GOTO 7800
7899 RETURN
7900 REM BANNER
7910 INVERSE : FOR I = 2 TO 6
7920 VTAB I: FOR J = 8 TO 31
7930 HTAB J: PRINT " ";: NEXT J: NEXT I
7940 PRINT
7950 A$ = "ADDITION DRILL": VTAB 3: HTAB 13: PRINT A$
7960 A$ = "TEACHER INITIALIZATION": VTAB 5: HTAB 9: PRINT A$
7995 NORMAL
7999 RETURN
9000 REM DATA DIRECTORY
9001 REM A$ - GEN'L PURPOSE USE IN GET
9002 REM A(7) - ANSWER ARRAY
9003 REM C(7) - CARRY ARRAY
9004 REM D$ - CNTL-D
9008 REM E(4) - ERROR COUNTS 0-CARRY, 1-ANSWER, 2-CARRY RETRY, 3-ANSWER RETRY
9010 REM M9 - NO. OF PROBLEMS PER DRILL
9019 REM N$ - STUDENT7S NAME
9020 REM N0 - NO. OF NUMBERS TO ADD PER PROBLEM
9024 REM P - COUNT OF PROBLEM NUMBER
9025 REM P(6,7) - 2-D ARRAY OF THE PROBLEM
9030 REM S0 - SIZE OF EACH NUMBER